Skip to content

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Oct 6, 2025

Overview

The syncing component was not saving header and event to the goheader (p2p) store.
Which was an issue when peers were asking for heights.

Copy link
Contributor

github-actions bot commented Oct 6, 2025

The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedOct 7, 2025, 9:05 PM

Copy link
Contributor

Summary of Changes

Hello @julienrbrt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the node's syncing component failed to broadcast newly acquired headers and data to the peer-to-peer network. By introducing a standardized Broadcaster interface and integrating its functionality into the syncer's block processing logic, the changes ensure that all successfully synced blocks are properly propagated across the network, improving network consistency and data availability for other nodes.

Highlights

  • Introduced Broadcaster Interface: A new generic Broadcaster interface was added to abstract P2P broadcasting and header store access, standardizing how headers and data are propagated.
  • Enabled P2P Broadcasting in Syncer: The syncing component now actively broadcasts newly processed headers and data to the P2P network, ensuring that all synced blocks are propagated.
  • Refactored Component Dependencies: Various components, including Syncer and Executor, along with their constructors, were updated to depend on the new Broadcaster interface, replacing direct goheader.Store implementations or internal broadcaster types.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly refactors the broadcasting logic by introducing a common Broadcaster interface and moving it to a shared package. This change also enables broadcasting of headers and data from sync nodes, which was the main goal.

I've found one critical issue where the wrong broadcaster was used to get the data height, which would break data syncing. I've also left a medium-severity comment regarding duplicated test mocks, which could be refactored to improve maintainability.

Once the critical issue is addressed, this PR should be good to go.

This comment was marked as outdated.

This comment was marked as outdated.

@julienrbrt julienrbrt marked this pull request as draft October 6, 2025 15:08
@julienrbrt julienrbrt changed the title fix(block/syncing): broadcast on sync nodes fix(block/syncing): save data to p2p stores Oct 6, 2025
@julienrbrt julienrbrt marked this pull request as ready for review October 6, 2025 15:36
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 51.89873% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.21%. Comparing base (184f42f) to head (0f8ac38).

Files with missing lines Patch % Lines
block/internal/syncing/p2p_handler.go 47.54% 30 Missing and 2 partials ⚠️
block/internal/syncing/syncer_mock.go 10.00% 27 Missing ⚠️
block/internal/syncing/syncer.go 73.33% 13 Missing and 3 partials ⚠️
pkg/sync/sync_service.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2736      +/-   ##
==========================================
+ Coverage   62.17%   62.21%   +0.03%     
==========================================
  Files          79       79              
  Lines        8497     8508      +11     
==========================================
+ Hits         5283     5293      +10     
+ Misses       2721     2720       -1     
- Partials      493      495       +2     
Flag Coverage Δ
combined 62.21% <51.89%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

@julienrbrt julienrbrt requested review from alpe and tac0turtle October 7, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants